package gogogo.liwushuo.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

import gogogo.liwushuo.fragment.SubHomeFragment;

/**
 * Created by chenjun on 2016/7/19.
 */
public class VpAdapter extends FragmentPagerAdapter {

    private List<SubHomeFragment> fragments;

    public VpAdapter(FragmentManager fm,List<SubHomeFragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments == null ? 0 : fragments.size();
    }


}
